News Ticker Applet

 

Required Class Files: nticker.class, ntread.class

Notice Tag: "News Ticker, (c) 1997, OpenCube Technologies, Registered (Unique Key ID#)"

 

Information about the applet and its parameters

Required Parameters

Parameter 1 (the "notice" tag) must be included in the applet tag in order for the applet to work. Most of the parameters will default if you fail to define them, at a minimum you must include the notice tag and and a file location tag pointing to your first scrolling file. Usually the easiest way to customize the applet is to cut and paste the applet tag information used in the sample and modify it to fit your web page.

 

Defining Colors

This applet uses a simple RGB or Hexadecimal color definition scheme. On most systems (depending on the software being used to choose a color) its easier to define a color using RGB, however since most web pages define colors using a HEX value we have allowed for both methods of color definition. To define a color using RGB use commas to separate the values such as 255,255,255 (White). To define a color using a hexadecimal value use a pound sign ('#') followed by a 6 digit hex value in the rage of 000000 - FFFFFF (e.g. #FFFFFF is equal to the color White).

Color Definition with RGB: To define a color in one of the color parameters using RGB choose a value between 0 - 255 for the red, green, and blue components separated by commas and typed out in the correct r,g,b order. Below is a sample of how a color parameter using RGB should look, the example specifies several different sample colors for the "bgcolor" parameter.

WHITE: <param name="bgcolor" value="255,255,255">
GREEN: <param name="bgcolor" value="0,255,0">
BLACK: <param name="bgcolor" value="0,0,0">
YELLOW: <param name="bgcolor" value="255,255,0">
OFF WHITE: <param name="bgcolor" value="240,239,234">

The best way to choose the exact color you are looking for without having to guess the numbers is to access your systems Color Picker. Color Pickers usually allow you to drag the mouse over a rainbow type color grid to select a color, and show you the appropriate RGB values. In windows the Color Picker is accessible through MS Paint as well as a majority of the popular Imaging and HTML Authoring Software.

 

Defining Multiple Attributes with the same parameter name

Parameters used to customize a specific message are indicated using a range, such as "desc0" - "descN". To define a parameter for a specific message (available when noted as above), use "textcolor0" to define, in this case, the text color for the first message - "textcolor3" would define the text color for the fourth message, etc., etc.

 

Creating the Files

This applet uses simple text files in order to define each scroll pages message, message attributes, sizing, URL links, colors, pause delay times, etc. Below are links to the two pages used in the example above...

Each line in the text file represent a customizable section of the scroll message. Each line must be specified with a series of values identifying the size pause, pause delay time, font size, font type, text color, load URL where, URL, message. Each value must be separated by a vertical bar ("|" AKA: pipe symbol). Below is an example of how a line of text which has specific attributes customized should look.

size pause|pause delay time| font size|font type|text color|load URL where|URL|message.

To specify a section of the scroll message using the default values defined using the parameters just use the message text without any pipe symbols for that line. If defining some properties but not all make shore to includes all the pipe symbols and leave sections that are to be defaults blank. (Note: blank spaces between unused pipes will cause errors).

For information regarding how to define specific attributes see the descriptions for their default parameter definitions below.

 

 

The Applet Parameters

 

The Applet

Parameter 1
Attribute: Copyright notice.
param name="Notice"
value="News Ticker, (c) 1997, OpenCube Technologies, Registered (Unique Key ID#)"
Note: This must be included for the applet to work.

Parameter 2
Attribute: Background Color
param name= "bgcolor"
Value=r,g,b or #000000 - #FFFFFF - See above for more information on defining colors.
DEFAULT: WHITE

Parameter 3
Attribute: Message Scroll Delay
param name = "scrolldelay"
value="X", where X is the delay time in milliseconds between animation frames. Note: any value less than 5 will force the message to scroll at the maximum speed the local systems CPU will allow for. To time the applet and get the same results between different systems running at different speeds use a value greater than 5. Hint: If a value of 5 is to slow and a value less than 5 is to fast you can adjust scroll speed further using scrolljump parameter.
DEFAULT: 25

Parameter 3
Attribute: Message Scroll Jump
param name = "scrolljump"
value="X", where X is the distance in screen pixels to jump between frames. Note: The minimum value is one. The higher the value the faster the animation will run and the choppier the effect.
DEFAULT: 1

Parameter 4
Attribute: Default Status Bar Text when mouse is over applet
param name = "onsbtext"
value="X", where X is the message to appear in the status bar when the mouse is over the applet but not over a URL link.
DEFAULT: "OpenCube - News Ticker"

Parameter 5
Attribute: Default Status Bar Text when mouse is off applet
param name = "offsbtext"
value="X", where X is the message to appear in the status bar when the mouse is not over the applet.
DEFAULT: "Java By Opencube"

 

The File Attributes

Parameter 6
Attribute: Initial File Location
param name = "filelocation"
value="X", where X is the relative location and name of the initial file to load. The file must be specified relative to the document containing the applet. Note: All subsequent applet loading page references must also be defined relative to the document containing the applet.

Parameter 7
Attribute: Scroll Document Update Status Bar Text
param name = "sbupdatetext"
value="X", Where X is the message to be show in the status bar while the current scroll document is being refreshed.
DEFAULT: "Updating Scroll Data..."

Parameter 8
Attribute: Document Refresh Scroll Interval
param name = "refreshscrollinterval"
value="X", where X is the scroll interval on which to refresh the current document. A value of one forces the current scroll file to be re-read at the end of every scroll cycle, a value of two forces the refresh every other scroll cycle, etc.
DEFAULT: 1

Parameter 9
Attribute: Document Refresh Time Interval
param name = "refreshtimeinterval"
value="X", where X is the specific amount of time in seconds to transpire before rereading the data from the file. Note: this parameter used in conjunction with the above refreshinterval parameter will force the document to be refreshed on both the scroll interval and time interval or which ever one comes first.
DEFAULT: 0

Parameter 10
Attribute: Force an Immediate Redraw of the Updated Scroll Screen
param name = "forceimmediate"
value = true or false - When set to true this and if a refresh time interval is specific with the above parameter the loaded page will immediately start scrolling no matter where the current scrolling document is located. If set to false the applet waits for the current document to complete its current scroll cycle before updating the message from the file.
DEFAULT: false

Parameter 11
Attribute: Document Refresh Time Interval
param name = "refreshtimeinterval"
value="X", where X is the specific amount of time in seconds to transpire before rereading the data from the file. Note: this parameter used in conjunction with the above refreshinterval parameter will force the document to be refreshed on both the scroll interval and time interval or which ever one comes first.
DEFAULT: 1

Parameter 12
Attribute: File Start Index Description Pointer
param name = "filestartindex"
value="X", Where x is the index pointer to start the information read from the file relative to the specific parameter definitions. This tag is provided primarily for convenience and efficiency when using multiple pages that all contain the same header descriptions. Note: A value of one forces the file information to start after the first parameter description (desc0), a value of two forces the file information to start after the "desc0" and "desc1" tags, etc.
DEFAULT: 0

Parameter 13
Attribute: Wait for refreshed files to load before scrolling the document
param name = "waitforfile"
value= true or false, Where True = yes, wait for the refreshed file to completely load before the document is scrolled. Note: a value of true will force the applet to pause (if a scroll cycle is defined) between scroll cycles while the refreshed document is loading, using a value of true with a refresh interval of 1 forces the applet to updates its data after every scroll cycle. False = no, continue to scroll the document while loading the updated file. False does not force the applet to pause between scroll cycles and updates the data from the file while scrolling (achieved from a separate thread for consistent scrolling), however the applet must scroll twice before the initial update is achieved, all subsequent updates happen on every scroll. The basic procedure when false is to get the updated document, while scrolling the previous document then at the end of the scroll cycle show the document fetched while retrieving the next update, etc., etc.
DEFAULT: false

Parameter 14
Attribute: Scroll After Local Load
param name = "scrollafterlocalload"
value=true or false, True = yes when opening a new page in the applet, continue to scroll the document, False = no, when opening a new page in the applet stop the document from scrolling.
DEFAULT: false

Parameter 15
Attribute: Use an Overlap Transition when Loading Pages in the Applet
param name = "overlaplocalload"
value=true or false, true = Yes, use an overlap transition effect when loading the next document. false = no first clear the screen then start the next document scrolling.
DEFAULT: true

 

The Scrolling Messages

Parameter 16
Attribute: Default Text Color
param name= "textcolor"
Value=r,g,b or #000000 - #FFFFFF - See above for more information on defining colors.
DEFAULT: BLACK

Parameter 17
Attribute: Default Message Font Size
param name="size"
value="X", where X is the default size of all message fonts.
DEFAULT: 14

Parameter 18
Attribute: Default Message Font Name
param name="fontface"
value="X", where X is the name of a standard Java Font (Dialog, Helvetica, TimesRoman, Courier, Symbol)
DEFAULT: "Helvetical"

Parameter 19
Attribute: Default Font Style
param name="style"
value= bold, italic, bolditalic, plain
DEFAULT: plain

Parameter 20
Attribute: Bottom Margin
param name="yoffset"
Value = X, Where X is the distance in screen pixels from the bottom of the applet to draw the scrolling message..
DEFAULT: 5

Parameter 21
Attribute: Default Message Pause Times
param name = "delay"
value="X", where X is the pause time in milliseconds (1000 = 1 second) for a message when it reaches the left of the applet space, a value of 0 (the default) forces the messages to continually scroll with no pause. Hint: to pause text in the center of the applet or at a specified offset from the left add spaces to the beginning of the description or add another description before the message to be paused with spaces and the customized pause time.
DEFAULT: 0

Parameter 22
Attribute: Default Automatically Size the Starting Position of the following Message.
param name="sizepause"
Value=0 or 1 or 2: 0 = do nothing, this is the default value, 1 = Identifies a message as the starting message to be automatically sized to fit applet area, 2 = Identifies the ending message to be sized. To automatically size messages that span multiple description tags, simply set the starting message to 1 and the ending message to 2 with this parameter. For example if you wanted your desc2 and desc3 tags to scroll on the screen and your desc3 tag to start scrolling only after desc2 started off the screen you would simply identify the desc2 as a start sizing message by setting "sizepuase2" = 1 and define desc3 as the end sizing message with "sizepause3" = 2. To size only one message to fit the applet width only identify that message as a ending message and do not define a starting message (e.g. "sizepause2" = 2, forces the desc2 message to scroll all the way to the top of the applet before desc3 start scrolling into view.)

Parameter 23
Attribute: Highlight Color
param name= "hlcolor"
Value=r,g,b or #000000 - #FFFFFF - See above for more information on defining colors.
DEFAULT: Yellow

 

URL Link Defaults

Parameter 24
Attribute: Default Load Destination URL Link Where? (Frame Targeting)
param name="loadwhere"
The "loadwhere" tag specifies where the document specified in the "desturlN" tags should be loaded. The default is "_self"

"applet" show in the applet
"_self" show in the current frame
"_parent" show in the parent frame
"_top" show in the top-most frame
"_blank" show in a new unnamed top-level window
"name" show in a new top-level window named name


News Ticker, © 1997, OpenCube Technologies